package com.bbcare.nutritious.plat.store.ibatis;

import java.util.List;
import java.util.Map;

import com.bbcare.nutritious.plat.entity.PtActivitiesDaily;
import com.bbcare.nutritious.plat.entity.PtHeartratesRecord;
import com.bbcare.nutritious.plat.entity.PtHuamiToken;
import com.bbcare.nutritious.plat.entity.PtSleepDaily;

/**
 * 
 * @name:         IActivityHuamiDao.java
 * @author:       tao
 * @createTime:   2017年7月3日
 * @description:  
 * @modify:
 *
 */
public interface IActivityHuamiDao {
	
	//保存
  	void savePtHuamiToken(List<PtHuamiToken> tokens) throws Exception;
  	
  	//查询用户之前绑定的token
  	List<PtHuamiToken> selectHuamiTokenByUserId(Map<String,Object> param) throws Exception; 
  	
  	void updatePtHuamiToken(Map<String,Object> param) throws Exception;
  	
  	//保存步数数据
  	void savePtActivitiesDaily(List<PtActivitiesDaily> tokens) throws Exception;
  	//保存步数历史
  	void savePtActivitiesDailyHis(List<PtActivitiesDaily> tokens) throws Exception;
  	//修改步数
  	void updateActivitiesDaily(PtActivitiesDaily activitiesDaily)throws Exception;
  	//删除最后一天数据 重新更新
  	void deleteLastActivitiesDaily(Map<String,Object> param) throws Exception;
  	
  	//保存睡眠数据
  	void savePtSleepDaily(List<PtSleepDaily> tokens) throws Exception;
  	//保存步数数据
  	void deleteLastSleepDaily(Map<String,Object> param) throws Exception;
  	//保存心跳数据
  	void savePtHeartratesRecord(List<PtHeartratesRecord> tokens) throws Exception;
  	
  	//查询
  	List<PtHuamiToken> selectPtHuamiTokenList(Map<String,Object> param) throws Exception; 
  	
  	List<Map<String,Object>> selectPtHuamiTokenMapList(Map<String,Object> param) throws Exception; 
	//查找总数
  	int selectPtHuamiTokenMapCount(Map<String,Object> param) throws Exception; 

  	//查询需要同步小米手环数据的租户
  	List<Map<String,Object>> selectActiveRuleList(Map<String,Object> param) throws Exception; 
  	
  	//查询上一次同步到的最后日期
  	Map<String,Object> selectActivitiesLastDate(Map<String,Object> param) throws Exception; 
  	Map<String,Object> selectSleepLastDate(Map<String,Object> param) throws Exception; 
  	String selectHeartratesLastDate(Map<String,Object> param) throws Exception;
  	
  	List<Map<String,Object>> selectActivityPatientList(Map<String,Object> param) throws Exception; 
	//查找总数
  	int selectActivityPatientCount(Map<String,Object> param) throws Exception; 
  	
  	List<Map<String,Object>> selectSleepPatientList(Map<String,Object> param) throws Exception; 
	//查找总数
  	int selectSleepPatientCount(Map<String,Object> param) throws Exception; 
  	
  	//查询某用户 运动记录列表
  	List<Map<String,Object>> selectActivitiesList(Map<String,Object> map)throws Exception;
  	//查询某用户 睡眠监测记录列表
  	List<Map<String,Object>> selectSleepList(Map<String,Object> map)throws Exception;
  	/**
  	 * 查询当天是否存在步数的数据
  	 */
  	List<Map<String,Object>> getStepForDate(Map<String,Object> map)throws Exception;
  	
  	
}
